package com.flexcodejam.vfd.business {
	
	import mx.rpc.events.ResultEvent;
	import mx.collections.ArrayCollection;
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import com.flexcodejam.vfd.vo.FoodDrive;
	import com.flexcodejam.vfd.vo.User;

	public class FoodDriveDelegate
	{
		public function FoodDriveDelegate( responder : IResponder )
		{
			this.service = ServiceLocator.getInstance().getRemoteObject("FoodDriveService");
			this.responder = responder;

		}
		
		public function GetFoodDriveById(foodDrive:FoodDrive): void
		{	
			var call : Object = service.GetFoodDriveById(foodDrive.ID);
			call.addResponder( responder );
		}
		
		public function GetFoodDriveByManagerId(user:User): void
		{	
			var call : Object = service.GetFoodDriveByManagerId(user.ID);
			call.addResponder( responder );
		}
		
		public function GetAllFoodDrives(): void
		{	
		var call : Object = service.GetAllFoodDrives();
			call.addResponder( responder ); 
	 	}
		
		public function GetReportFoodDrives(): void
		{	
			var call : Object = service.GetReportFoodDrives();
			call.addResponder( responder );
		}
		
		public function SaveFoodDrive(foodDrive:FoodDrive): void
		{	
			var call : Object = service.SaveFoodDrive(foodDrive);
			call.addResponder( responder );
		}
		
		private var responder : IResponder;
		private var service : Object;
	}

}
